package com.pine.dcts;

import com.pine.app.module.security.core.authorize.annotation.EnableMethodSecurity;
import com.pine.app.module.security.oauth.annotation.EnableAuthorizationServer;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;



/**
 * @author xiaoyuan
 * @create 2020/6/29 16:45
 **/
@Configuration
@SpringBootApplication
@ComponentScan("com.pine")
@Slf4j
@EnableAsync
@MapperScan("com.pine.**.mapper")
@EnableAuthorizationServer
@EnableMethodSecurity
public class Application  extends SpringBootServletInitializer {

    public static void main(String[] args)
    {
        SpringApplication.run(Application.class, args);

//        MyQuartzJobBean myQuartzJobBean  = new MyQuartzJobBean();
//        myQuartzJobBean.setId("tet");
//        myQuartzJobBean.setCronExpression("0/10 * * * * ?");
//        myQuartzJobBean.setGroupId("test");
//        myQuartzJobBean.setJobName("cccc");
//        myQuartzJobBean.setGroupName("tttttttttttt");
//        MyQuartzJobBean1 myQuartzJobBean1  = new MyQuartzJobBean1();
//        myQuartzJobBean1.setId("tet");
//        myQuartzJobBean1.setCronExpression("0/20 * * * * ?");
//        myQuartzJobBean1.setGroupId("test");
//        myQuartzJobBean1.setJobName("cccc1");
//        myQuartzJobBean1.setGroupName("tttttttttttt1");
//        try {
//            DynamicScheduler.addJob(myQuartzJobBean);
//            DynamicScheduler.addJob(myQuartzJobBean1);
//        } catch (SchedulerException e) {
//            e.printStackTrace();
//        }

//        DataxJob dataxJob = new DataxJob();
//        dataxJob.setCoreType(1);
//        dataxJob.setExeType(2);
//        dataxJob.setMinnum(3);
//        dataxJob.setId("tet6");
//        dataxJob.setGroupId("test3");
//        dataxJob.setJobName("cccc");
//        dataxJob.setGroupName("tttttttttttt");
//        try {
//            DynamicScheduler.addJob(dataxJob);
//        } catch (SchedulerException e) {
//            e.printStackTrace();
//        }
    }
}
